'use client'

import Image from "next/image";

import { Button } from '@mui/material';

import { ethers } from "ethers";

// Import just a few select items
import { BrowserProvider, parseUnits } from "ethers";

// Import from a specific export
import { HDNodeWallet } from "ethers/wallet";

export default function Home() {


    const connect=async ()=>{

        let signer = null;

        let provider;
        if (window.ethereum == null) {

            console.log("MetaMask not installed; using read-only defaults")
            provider = ethers.getDefaultProvider()

        } else {
            provider = new ethers.BrowserProvider(window.ethereum)

            signer = await provider.getSigner();
        }

    }
  return (
    <main className="flex min-h-screen flex-col items-center justify-between p-24">
      <div className="z-10 max-w-5xl w-full items-center justify-between font-mono text-sm lg:flex">

          <Button variant="contained" color="primary" onClick={connect}>
              链接钱包
          </Button>

      </div>
    </main>
  );
}
